export default {

  // 获取购物车的总数量 
  allCart(state) {
    let allCount = 0
    let allPrice = 0

    state.cartInfo.forEach(item => {
      if (item.isChecked) {
        allPrice += item.count * item.price * 100
      }
      allCount += item.count
      if (allCount < 99) {
        return allCount
      } else {
        return allCount = '99+'
      }

    })

    return {
      allCount,
      allPrice
    }
  }
}